@import '../../style/themes/index.less';

@preview-prefix-cls: ~'@{prefix}-preview';

.@{preview-prefix-cls} {
  position: relative;
  background-color: #ffffff;
  font-size: 28px;

  &:before {
    content: ' ';
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    height: 2px;
    border-top: 2px solid rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.1);
    -webkit-transform-origin: 0 0;
    transform-origin: 0 0;
    -webkit-transform: scaleY(0.5);
    transform: scaleY(0.5);
  }

  &:after {
    content: ' ';
    position: absolute;
    left: 0;
    bottom: 0;
    right: 0;
    height: 2px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.1);
    -webkit-transform-origin: 0 100%;
    transform-origin: 0 100%;
    -webkit-transform: scaleY(0.5);
    transform: scaleY(0.5);
  }

  &__hd {
    position: relative;
    padding: 15px 32px;
    text-align: right;
    line-height: 2.5em;

    &:after {
      content: ' ';
      position: absolute;
      left: 0;
      bottom: 0;
      right: 0;
      height: 2px;
      border-bottom: 2px solid rgba(0, 0, 0, 0.1);
      color: rgba(0, 0, 0, 0.1);
      -webkit-transform-origin: 0 100%;
      transform-origin: 0 100%;
      -webkit-transform: scaleY(0.5);
      transform: scaleY(0.5);
    }

    .@{preview-prefix-cls}__label {
      text-align-last: auto;
      color: #666;
    }
    .@{preview-prefix-cls}__value {
      font-style: normal;
      font-size: 32px;
      color: #333;
    }
  }

  &__bd {
    padding: 32px;
    font-size: 28px;
    text-align: right;
    color: rgba(0, 0, 0, 0.5);
    line-height: 2;
  }

  &__ft {
    position: relative;
    line-height: 100px;
    display: flex;

    &:before {
      content: ' ';
      position: absolute;
      left: 0;
      top: 0;
      right: 0;
      height: 2px;
      border-top: 2px solid rgba(0, 0, 0, 0.1);
      color: rgba(0, 0, 0, 0.1);
      -webkit-transform-origin: 0 0;
      transform-origin: 0 0;
      -webkit-transform: scaleY(0.5);
      transform: scaleY(0.5);
    }
  }

  &__item {
    overflow: hidden;
  }

  &__label {
    float: left;
    margin-right: 1em;
    min-width: 4em;
    color: rgba(0, 0, 0, 0.5);
    text-align: justify;
    text-align-last: justify;
  }

  &__value {
    display: block;
    overflow: hidden;
    word-break: normal;
    word-wrap: break-word;
    min-height: 2em;
    font-size: 28px;
  }

  &__btn {
    position: relative;
    display: block;
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    color: #576b95;
    text-align: center;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    user-select: none;
    -webkit-user-select: none;

    &:active {
      background-color: #ececec;
    }

    &:after {
      content: ' ';
      position: absolute;
      left: 0;
      top: 0;
      width: 2px;
      bottom: 0;
      border-left: 2px solid rgba(0, 0, 0, 0.1);
      color: rgba(0, 0, 0, 0.1);
      -webkit-transform-origin: 0 0;
      transform-origin: 0 0;
      -webkit-transform: scaleX(0.5);
      transform: scaleX(0.5);
    }

    &:last-child {
      &:before {
        content: ' ';
        position: absolute;
        right: 0;
        top: 0;
        width: 2px;
        bottom: 0;
        border-right: 2px solid rgba(0, 0, 0, 0.1);
        color: rgba(0, 0, 0, 0.1);
        -webkit-transform-origin: 0 0;
        transform-origin: 0 0;
        -webkit-transform: scaleX(0.5);
        transform: scaleX(0.5);
      }
    }
  }

  &__btn_default {
    color: rgba(0, 0, 0, 0.9);
  }
  &__btn_primary {
    color: darken(@primary-color, 10%);
  }

  &-align-left {
    .@{preview-prefix-cls}__bd {
      text-align: left;
    }
  }
}

.preview-item {
  &:before,
  &:after {
    content: '';
    display: table;
    box-sizing: border-box;
  }

  &:after {
    clear: both;
  }

  &[class*='preview-item-arrow'] {
    .weui-preview-ft {
      padding-right: 44px;
      position: relative;

      &:after {
        content: ' ';
        width: 24px;
        height: 48px;
        -webkit-mask-position: 0 0;
        mask-position: 0 0;
        -webkit-mask-repeat: no-repeat;
        mask-repeat: no-repeat;
        -webkit-mask-size: 100%;
        mask-size: 100%;
        background-color: currentColor;
        color: rgba(0, 0, 0, 0.3);
        -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
        mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
        position: absolute;
        top: 50%;
        right: 0;
        margin-top: -24px;
      }
    }
  }

  &.preview-item-arrow-down {
    .weui-preview-ft:after {
      transform: rotate(90deg);
    }
  }
  &.preview-item-arrow-up {
    .weui-preview-ft:after {
      transform: rotate(-90deg);
    }
  }
}
